package com.cskaoyan._05waitnotify;

/**
 * @description:
 * @author: 景天
 * @date: 2023/2/22 15:11
 **/
/*
wait方法的使用条件
    必须有sync,在锁对象上调用wait
 */
public class Demo {
    public static void main(String[] args) {
        Object o = new Object();
        try {
            // java.lang.IllegalMonitorStateException
            o.wait();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
